package org.jcut.controller;

import org.jcut.data.Data;
import org.jcut.service.ITimgService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/timg")
public class TimgController {
	@Autowired
	private ITimgService service;
	@Autowired
	private Data data;
	/**
	 * @author 胡琪
	 * @param t_id 图片id(必填)
	 * */
	@RequestMapping(value = "/select",params = {"t_id"},method = RequestMethod.GET)
	public Data select(@RequestParam(value="t_id")String t_id) {
		data.setStatus("1");
		data.setMsg("查询成功！");
		data.setData(service.select(t_id));
		return data;
	}
}
